import 'package:flutter/material.dart';

typedef void OnTap();
class ImageTitleButton extends StatelessWidget {

  final Widget bottomWidget;
  final Widget topWidget;
  final OnTap onTap;
  final double space;//上下间隔
  
  const ImageTitleButton({Key key, @required this.bottomWidget,@required this.topWidget, this.onTap, this.space = 8}) : super(key: key);@override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () => onTap(),
      child: Column(
        // crossAxisAlignment: CrossAxisAlignment.center,
        // mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          topWidget,
          Padding(
            padding: EdgeInsets.only(top: space),
            child: bottomWidget,
          ),
        ],
      ),
    );
  }
}